package com.sand.entity;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Objects;

@Entity
@Table(name = "ordertable", schema = "ssh_pro", catalog = "")
public class OrdertableEntity {
    /**
     * @author <achao1441470436@gmail.com>
     * @since 2021/11/28/028 14:46
     */
    private int rid;
    private int userId;
    private int houseId;
    private Timestamp leaseEffectiveTime;
    private Timestamp leaseExpirationTime;
    private int totalRentalPrice;
    private int status;
    private String remark;

    @Id
    @Column(name = "rid")
    public int getRid() {
        return rid;
    }

    public void setRid(int rid) {
        this.rid = rid;
    }

    @Basic
    @Column(name = "userId")
    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    @Basic
    @Column(name = "houseId")
    public int getHouseId() {
        return houseId;
    }

    public void setHouseId(int houseId) {
        this.houseId = houseId;
    }

    @Basic
    @Column(name = "leaseEffectiveTime")
    public Timestamp getLeaseEffectiveTime() {
        return leaseEffectiveTime;
    }

    public void setLeaseEffectiveTime(Timestamp leaseEffectiveTime) {
        this.leaseEffectiveTime = leaseEffectiveTime;
    }

    @Basic
    @Column(name = "leaseExpirationTime")
    public Timestamp getLeaseExpirationTime() {
        return leaseExpirationTime;
    }

    public void setLeaseExpirationTime(Timestamp leaseExpirationTime) {
        this.leaseExpirationTime = leaseExpirationTime;
    }

    @Basic
    @Column(name = "totalRentalPrice")
    public int getTotalRentalPrice() {
        return totalRentalPrice;
    }

    public void setTotalRentalPrice(int totalRentalPrice) {
        this.totalRentalPrice = totalRentalPrice;
    }

    @Basic
    @Column(name = "status")
    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    @Basic
    @Column(name = "remark")
    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        OrdertableEntity that = (OrdertableEntity) o;
        return rid == that.rid && userId == that.userId && houseId == that.houseId && totalRentalPrice == that.totalRentalPrice && Objects.equals(leaseEffectiveTime, that.leaseEffectiveTime) && Objects.equals(leaseExpirationTime, that.leaseExpirationTime) && Objects.equals(status, that.status) && Objects.equals(remark, that.remark);
    }

    @Override
    public int hashCode() {
        return Objects.hash(rid, userId, houseId, leaseEffectiveTime, leaseExpirationTime, totalRentalPrice, status, remark);
    }
}
